import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt'
import { PassportModule } from '@nestjs/passport'
import { UserModule } from 'src/database/user/user.module'
import { AuthService } from './auth.service';
import { jwtConstants } from 'src/constants';
import { JwtStrategy } from './jwt.strategy'
import { LocalStrategy } from './local.strategy'

@Module({
  imports:[
    UserModule,
    PassportModule,
    JwtModule.register({
      // 配置密匙
      secret: jwtConstants.secret,
      // 配置Token过期时间
      signOptions: { expiresIn: '10h' },
    })
  ],
  providers: [AuthService,LocalStrategy, JwtStrategy],
  exports:[AuthService]
})
export class AuthModule {}
